#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/3/8 17:36
# @Author  : jeff
# @FileName: exception_vo
from src.vo.response import create_response
from src.enums.status_enum import Status


class BaseError(Exception):
    """Exception base class"""

    def __init__(self, status, message):
        self.status = status
        self.message = message

    def to_response(self):
        return create_response(
            status=self.status,
            message=self.message,
        )


class ValidationError(BaseError):
    """Data verification exception - parameter validation error"""

    def __init__(self, message):
        super().__init__(status=Status.BAD_MESSAGE, message=message)


class NotFindError(BaseError):
    """Data not found - parameter validation error"""

    def __init__(self, message):
        super().__init__(status=Status.BAD_MESSAGE, message=message)